<?php

class AdminModel
{
    private $conn = null;
    function __construct() 
    {
        $this->conn = new mysqlconnect(Yaf_Registry::get('dbconfig'));
        $this->conn->connect();
    }
    public function Login($username,$password)
    {
        $sql = 'SELECT COUNT(id) state FROM administrator WHERE admin_name=? AND admin_password=?';
        $result = $this->conn->fetch($sql,array($username,$password));
        return intval($result[0]['state']) ? true : false;
    }

}
?>
